﻿namespace SharpSoft.Models
{
    public class TaskModel
    {
        [SharpSoft.Data.AutoField]
        [SharpSoft.Data.PrimaryKey]
        public long Id { get; set; }
        /// <summary>
        /// 任务优先级
        /// </summary>
        public int Priority { get; set; }
        public string? TypeFlag { get; set; }
        public string? Name { get; set; }

        [SharpSoft.Data.DontJoinInsert]
        public DateTime CreateTime { get; set; }

        public DateTime? PresetTime { get; set; }

        public DateTime? StartTime { get; set; }

        public DateTime? StopTime { get; set; }
        public string? ErrorMessage { get; set; }

        public bool IsExpired { get; set; }

        public string Data { get; set; }

        public TaskState State { get; set; }
    }

    public enum TaskState
    {
        None=0,
        Executing=1,
        Executed=8,

        Failed=-1,

    }
}